import { defineStore } from "pinia";
import { store } from "../index"
// import { getAuthCache,setAuthCache } from '../../utils/auth'


export const executorStore = defineStore({

    state: () => ({
        executor: [],
        taskData: '',
        dialogData: '',
        fileData:''
    }),
    getters: {
        //获取执行人数据
        getUserExecutor() {
            //console.log(this.userInfo, getAuthCache(USER_INFO_KEY));
            return this.executor
        },
        getUserTaskData() {
            return this.taskData
        },
        getDialogTitle() {
            return this.dialogTitle
        }
    },
    actions: {
        setUserExecutor(info) {
            this.executor = info
        },
        setUserTaskData(info) {
            this.taskData = info
  
        },
        setUserDialogTitle(info) {
            this.dialogData = info
        },
        setUserFile(info) {
            this.fileData = info
        }
        // setUserFile(info) {
        //     this.fileData = info
        // }
    }
})

export function executorWithOut() {
    return executorStore(store);
}